package com.pro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * @author cyj
 * @date 2022.1.20$ 18.46$
 * @content :
 */
public class JsLoginRecord {
    private Integer id;
    private Integer userId;
    private String loginIp;
    private String loginAddress;
    private Integer loginState;
    private Integer loginType;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date loginDate;

    private String account;
    private String trueName;
    private String nickname;

    public JsLoginRecord() {
        super();
    }

    @Override
    public String toString() {
        return "JsLoginRecord{" +
                "id=" + id +
                ", userId=" + userId +
                ", loginIp='" + loginIp + '\'' +
                ", loginAddress='" + loginAddress + '\'' +
                ", loginState=" + loginState +
                ", loginType=" + loginType +
                ", loginDate=" + loginDate +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JsLoginRecord that = (JsLoginRecord) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(loginIp, that.loginIp) &&
                Objects.equals(loginAddress, that.loginAddress) &&
                Objects.equals(loginState, that.loginState) &&
                Objects.equals(loginType, that.loginType) &&
                Objects.equals(loginDate, that.loginDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, loginIp, loginAddress, loginState, loginType, loginDate);
    }

    public Integer getId() {
        return id;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getNickname() {
        return nickname;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public String getAccount() {
        return account;
    }

    public String getTrueName() {
        return trueName;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public String getLoginAddress() {
        return loginAddress;
    }

    public void setLoginAddress(String loginAddress) {
        this.loginAddress = loginAddress;
    }

    public Integer getLoginState() {
        return loginState;
    }

    public void setLoginState(Integer loginState) {
        this.loginState = loginState;
    }

    public Integer getLoginType() {
        return loginType;
    }

    public void setLoginType(Integer loginType) {
        this.loginType = loginType;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
}
